package me.yushuai.wukong.base.convertor;

import me.yushuai.wukong.base.api.dto.CreateZoneDTO;
import me.yushuai.wukong.base.api.dto.UpdateZoneDTO;
import me.yushuai.wukong.base.api.dto.ZoneDTO;
import me.yushuai.wukong.base.api.dto.ZoneGroupDTO;
import me.yushuai.wukong.base.api.vo.ZoneGroupVO;
import me.yushuai.wukong.base.api.vo.ZoneVO;
import me.yushuai.wukong.base.entity.Zone;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

import java.util.List;

/**
 * @author zhoushuai@189.cn
 * @since 2022-11-21
 */
@Mapper(componentModel = "spring")
public interface ZoneConvertor {

    @Mapping(target = "modifyTime", ignore = true)
    @Mapping(target = "modifyBy", ignore = true)
    @Mapping(target = "createTime", ignore = true)
    @Mapping(target = "createBy", ignore = true)
    public Zone mapToEntity(CreateZoneDTO createZoneDTO);

    @Mapping(target = "modifyTime", ignore = true)
    @Mapping(target = "modifyBy", ignore = true)
    @Mapping(target = "createTime", ignore = true)
    @Mapping(target = "createBy", ignore = true)
    public Zone mapToEntity(UpdateZoneDTO dto);

    public ZoneDTO mapToDto(Zone zone);

    public List<ZoneDTO> mapToDtoList(List<Zone> zones);

    ZoneVO mapToZoneVo(ZoneDTO zone);

    List<ZoneVO> mapToZoneVoList(List<ZoneDTO> zoneList);

    ZoneGroupVO mapToZoneGroupVo(ZoneGroupDTO zoneGroup);

    List<ZoneGroupVO> mapToZoneGroupVoList(List<ZoneGroupDTO> zoneGroupList);
}
